Skip to content

Move more components to tsx #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jun 22, 2025
Merged

Move more components to tsx #324

merged 29 commits into from
Jun 22, 2025

Conversation

PavelVanecek
Copy link
Contributor

No description provided.

@PavelVanecek PavelVanecek requested a review from Copilot June 22, 2025 08:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates several components to TypeScript and makes related configuration and dependency updates.

  • Update esbuild loader in vite.config.ts from 'jsx' to 'tsx'.
  • Migrate React components (IndexView, Frame, Affix) by removing PropTypes and adding TypeScript generics/interfaces.
  • Update package.json with new type definitions and dependency overrides, and remove outdated documentation.

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vite.config.ts Changed esbuild loader to support .tsx files.
src/views/IndexView.tsx Migrated component to TypeScript by adding RouteComponentProps to PureComponent.
src/layouts/Frame.tsx Removed PropTypes; updated component type with RouteComponentProps and adjusted imports.
src/components/Affix.tsx Replaced PropTypes with TS interfaces; improved type declarations and minor refactoring.
package.json Added new type definitions and dependency overrides.
docs/index.html Removed obsolete documentation file.
Comments suppressed due to low confidence (1)

src/views/IndexView.tsx:50

  • Ensure that RouteComponentProps provides all necessary properties for this component. If additional props are used, extend the interface accordingly to maintain clear API design.
class IndexView extends PureComponent<RouteComponentProps> {

Comment on lines +75 to +86
"overrides": {
"@reduxjs/toolkit": {
".": "^1.9.7",
"dependencies": {
"react": "17.0.1"
}
},
"react-redux": {
".": "^8.1.3",
"react": "17.0.1"
}
}
Copy link
Preview

Copilot AI Jun 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review the dependency override for React to ensure it aligns with the requirements of the consuming packages. Forced version overrides can lead to compatibility issues in future updates.

Suggested change
"overrides": {
"@reduxjs/toolkit": {
".": "^1.9.7",
"dependencies": {
"react": "17.0.1"
}
},
"react-redux": {
".": "^8.1.3",
"react": "17.0.1"
}
}
"overrides": {}

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove this when bumping to React 18+

@PavelVanecek
Copy link
Contributor Author

PavelVanecek commented Jun 22, 2025

The highlights are different. Maybe a bit better. Can't tell for sure.

Edit: aha! That's because of the element change. I imagine that the highlight is not set for JSX at all? I'll have a look when bumping it later.

On this branch:
image

On web:
image

@ckifer ckifer merged commit f7606e8 into master Jun 22, 2025
1 check passed
@PavelVanecek PavelVanecek deleted the tsx-2 branch June 22, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants